package com.nantong.common.core.enums.commonEnums;

import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 客户进展阶段枚举
 *
 * @author nantong
 */
@Getter
@AllArgsConstructor
public enum CustomerProgressStageEnum {
    INITIAL_CONTACT(1, "初次接触"),
    BUSINESS_NEGOTIATION(2, "商务谈判"),
    QUOTATION_STAGE(3, "报价阶段"),
    CONTRACT_SIGNING(4, "合同签署");

    @JsonValue
    private final Integer code;
    private final String desc;

    public static CustomerProgressStageEnum fromCode(Integer code) {
        for (CustomerProgressStageEnum value : CustomerProgressStageEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}